<script setup lang="ts">
import Child from '@/views/test/Child.vue'
import { ref } from 'vue'
const money = ref(20)
const msg = ref('啦啦啦')
const age = ref(18)
// const change = () => {
//   money.value = money.value + 10
// }
</script>

<template>
  <h1>父组件</h1>
  {{ money }} ---{{ msg }} ---{{ age }}
  <hr />
  <!-- $event传回来的值 -->
  <!-- <child :money="money" @ChangeMoney="money = $event"></child> -->
  <child
    v-model:money="money"
    :msg="msg"
    @update:msg="msg = $event"
    v-model="age"
  ></child>
  <!--  vue3 v-model 语法糖
    v-model="msg"
    :xx="msg" @update: xx="msg=$event"
   -->
</template>

<style lang="scss" scoped></style>
